package com.example.videodemo;

import com.example.jna.HCNetSDKByJNA;
import com.hikvision.netsdk.NET_DVR_DEVICEINFO_V30;

import java.io.Serializable;
import java.util.UUID;

/**
 * @brief 设备信息对象
 */
public class DeviceItem implements Serializable {
    public String m_szUUID;
    public String m_szDevName;
    public int m_lUserID = -1;
    public byte m_byLoginFlag = -1; // 设备登录方式，0-jni, 1-jna
    public DeviceState m_struDevState = new DeviceState();
    public RcvData m_rcvData;
    public HCNetSDKByJNA.NET_DVR_DEVICEINFO_V40 m_struDeviceInfoV40_jna;
    public NET_DVR_DEVICEINFO_V30 m_struDeviceInfoV30_jni;



    public DeviceItem() {
        m_szUUID = UUID.randomUUID().toString();
    }
    public DeviceItem(String szUUID) {
        m_szUUID = szUUID;
    }
    /**
     * @brief 设备状态对象
     */
    public class DeviceState implements Serializable {
        public int m_iLogState = 0; // 0-offline, 1-online, 2-dropoff
        public int m_iAlarmState = 0; // 0-alarmclosed, 1-alarmopen

        public void reset(){
            m_iLogState = 0;
            m_iAlarmState = 0;
        }
    }

}